import React, { Component } from 'react'
import Home from './view/home'
import Shop from './view/shop'
import { Routes, Route, Outlet, useLocation, useNavigate } from "react-router"
import { Tabbar } from 'react-vant'
import { FriendsO, HomeO, Search, SettingO } from '@react-vant/icons'
export default function App() {
  let locat = useLocation()
  let navi= useNavigate()
  console.log(locat);
    return (
      <div>
        <Routes>
          <Route element={<Home />} path='/home'></Route>
          <Route element={<Shop />} path='/shop'></Route>
        </Routes>



        <Tabbar  value={locat.pathname} onChange={v => navi(v)}>
          <Tabbar.Item name='/home' icon={<HomeO />}>
            标签
          </Tabbar.Item>
          <Tabbar.Item name='/shop' icon={<Search />}>
            标签
          </Tabbar.Item>
        </Tabbar>
      </div>
    )
  }


